﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Ops.Mpc.ExampleApplication.Web
{
    public class PersonNamesFactory : List<string>
    {
        private static RandomProvider _Random = new RandomProvider();
        
        /// <summary>
        /// A collection of standard female first names.
        /// </summary>
        public static readonly string[] FemaleFirstNames = new string[]
        {
            "Sophie"
            ,"Emma"
            ,"Lucy"
            ,"Katie"
            ,"Erin"
            ,"Ellie"
            ,"Amy"
            ,"Emily"
            ,"Chloe"
            ,"Olivia"
            ,"Hannah"
            ,"Jessica"
            ,"Grace"
            ,"Ava"
            ,"Rebecca"
            ,"Isla"
            ,"Brooke"
            ,"Megan"
            ,"Niamh"
            ,"Eilidh"
            ,"Eva"
            ,"Abbie"
            ,"Skye"
            ,"Aimee"
            ,"Mia"
            ,"Ruby"
            ,"Anna"
            ,"Sarah"
            ,"Rachel"
            ,"Caitlin"
            ,"Lauren"
            ,"Freya"
            ,"Keira"
            ,"Lily"
            ,"Leah"
            ,"Holly"
            ,"Millie"
            ,"Charlotte"
            ,"Abigail"
            ,"Molly"
            ,"Kayla"
            ,"Zoe"
            ,"Eve"
            ,"Iona"
            ,"Cara"
            ,"Ella"
            ,"Evie"
            ,"Nicole"
            ,"Morgan"
            ,"Jenna"
            ,"Madison"
            ,"Kayleigh"
            ,"Summer"
            ,"Paige"
            ,"Daisy"
            ,"Taylor"
            ,"Amelia"
            ,"Zara"
            ,"Beth"
            ,"Amber"
            ,"Robyn"
            ,"Georgia"
            ,"Shannon"
            ,"Sophia"
            ,"Courtney"
            ,"Jennifer"
            ,"Abby"
            ,"Neve"
            ,"Carly"
            ,"Casey"
            ,"Elizabeth"
            ,"Kaitlyn"
            ,"Poppy"
            ,"Melissa"
            ,"Jasmine"
            ,"Bethany"
            ,"Abi"
            ,"Gemma"
            ,"Laura"
            ,"Mya"
            ,"Kara"
            ,"Orla"
            ,"Elise"
            ,"Hayley"
            ,"Kelsey"
            ,"Charley"
            ,"Imogen"
            ,"Kirsty"
            ,"Rachael"
            ,"Heather"
            ,"Chelsea"
            ,"Layla"
            ,"Samantha"
            ,"Julia"
            ,"Maya"
            ,"Natalie"
            ,"Alice"
            ,"Libby"
            ,"Rhianna"
            ,"Rosie"};

        /// <summary>
        /// A collection of standard male first names.
        /// </summary>
        public static readonly string[] MaleFirstNames = new string[]
        {
             "Lewis"
            ,"Jack"
            ,"Ryan"
            ,"James"
            ,"Callum"
            ,"Cameron"
            ,"Daniel"
            ,"Liam"
            ,"Jamie"
            ,"Kyle"
            ,"Matthew"
            ,"Logan"
            ,"Finlay"
            ,"Adam"
            ,"Alexander"
            ,"Dylan"
            ,"Aiden"
            ,"Andrew"
            ,"Ben"
            ,"Aaron"
            ,"Connor"
            ,"Thomas"
            ,"Joshua"
            ,"David"
            ,"Ross"
            ,"Luke"
            ,"Nathan"
            ,"Charlie"
            ,"Ethan"
            ,"Aidan"
            ,"Michael"
            ,"John"
            ,"Calum"
            ,"Scott"
            ,"Josh"
            ,"Samuel"
            ,"Kieran"
            ,"Fraser"
            ,"William"
            ,"Oliver"
            ,"Rhys"
            ,"Sean"
            ,"Harry"
            ,"Owen"
            ,"Sam"
            ,"Christopher"
            ,"Euan"
            ,"Robert"
            ,"Kai"
            ,"Jay"
            ,"Jake"
            ,"Lucas"
            ,"Jayden"
            ,"Tyler"
            ,"Rory"
            ,"Reece"
            ,"Robbie"
            ,"Joseph"
            ,"Max"
            ,"Benjamin"
            ,"Ewan"
            ,"Archie"
            ,"Evan"
            ,"Leo"
            ,"Taylor"
            ,"Alfie"
            ,"Blair"
            ,"Arran"
            ,"Leon"
            ,"Angus"
            ,"Craig"
            ,"Murray"
            ,"Declan"
            ,"Zak"
            ,"Brandon"
            ,"Harris"
            ,"Finn"
            ,"Lee"
            ,"Lennon"
            ,"Cole"
            ,"George"
            ,"Jacob"
            ,"Mark"
            ,"Hayden"
            ,"Kenzie"
            ,"Alex"
            ,"Shaun"
            ,"Louis"
            ,"Caleb"
            ,"Mason"
            ,"Gregor"
            ,"Mohammed"
            ,"Luca"
            ,"Harrison"
            ,"Kian"
            ,"Noah"
            ,"Paul"
            ,"Riley"
            ,"Stuart"
            ,"Joe"
            ,"Jonathan"
            ,"Stephen"
        };

        /// <summary>
        /// A collection of surnames to use in name generation.
        /// </summary>
        public static readonly string[] Surnames = new string[] 
        {
             "SMITH"
            ,"BROWN"
            ,"WILSON"
            ,"THOMSON"
            ,"ROBERTSON"
            ,"CAMPBELL"
            ,"STEWART"
            ,"ANDERSON"
            ,"MACDONALD"
            ,"SCOTT"
            ,"REID"
            ,"MURRAY"
            ,"TAYLOR"
            ,"CLARK"
            ,"MITCHELL"
            ,"ROSS"
            ,"WALKER"
            ,"PATERSON"
            ,"YOUNG"
            ,"WATSON"
            ,"MORRISON"
            ,"MILLER"
            ,"FRASER"
            ,"DAVIDSON"
            ,"GRAY"
            ,"MCDONALD"
            ,"HENDERSON"
            ,"JOHNSTON"
            ,"HAMILTON"
            ,"GRAHAM"
            ,"KERR"
            ,"SIMPSON"
            ,"MARTIN"
            ,"FERGUSON"
            ,"CAMERON"
            ,"DUNCAN"
            ,"HUNTER"
            ,"KELLY"
            ,"BELL"
            ,"GRANT"
            ,"MACKENZIE"
            ,"MACKAY"
            ,"ALLAN"
            ,"BLACK"
            ,"MACLEOD"
            ,"MCLEAN"
            ,"RUSSELL"
            ,"GIBSON"
            ,"WALLACE"
            ,"GORDON"
            ,"MARSHALL"
            ,"STEVENSON"
            ,"WOOD"
            ,"SUTHERLAND"
            ,"CRAIG"
            ,"WRIGHT"
            ,"MCKENZIE"
            ,"KENNEDY"
            ,"JONES"
            ,"BURNS"
            ,"WHITE"
            ,"MUIR"
            ,"MURPHY"
            ,"JOHNSTONE"
            ,"HUGHES"
            ,"WATT"
            ,"MCMILLAN"
            ,"MCINTOSH"
            ,"MILNE"
            ,"MUNRO"
            ,"RITCHIE"
            ,"DICKSON"
            ,"BRUCE"
            ,"KING"
            ,"CRAWFOR"
            ,"DOCHERTY"
            ,"MILLAR"
            ,"CUNNINGHA"
            ,"SINCLAIR"
            ,"WILLIAMSON"
            ,"HILL"
            ,"MCGREGOR"
            ,"MCKAY"
            ,"BOYLE"
            ,"SHAW"
            ,"FLEMING"
            ,"MOORE"
            ,"CHRISTIE"
            ,"DOUGLAS"
            ,"DONALDSON"
            ,"ALEXANDER"
            ,"MACLEAN"
            ,"FORBES"
            ,"MCINTYRE"
            ,"FINDLAY"
            ,"JAMIESON"
            ,"AITKEN"
            ,"REILLY"
            ,"THOMPSON"
            ,"HAY"

        };
        /// <summary>
        /// Factory method used to create a first name (male).
        /// </summary>
        /// <returns>A random value from the MaleFirstNames collection.</returns>
        public static string CreateMaleFirstName()
        {
            return MaleFirstNames[_Random.Next(0, MaleFirstNames.Length - 1)];
        }
        /// <summary>
        /// Factory method used to create a first name (female).
        /// </summary>
        /// <returns>A random value from the FemaleFirstNames collection.</returns>
        public static string CreateFemaleFirstName()
        {
            return FemaleFirstNames[_Random.Next(0, FemaleFirstNames.Length - 1)];
        }
        /// <summary>
        /// Factory method used to create a last name.
        /// </summary>
        /// <returns>A random value from the Surnames collection.</returns>
        public static string CreateSurname()
        {
            char[] surname = Surnames[_Random.Next(0, Surnames.Length - 1)].ToLower().ToCharArray();
            surname[0] = Char.ToUpper(surname[0]);
            return new string(surname);
        }
        /// <summary>
        /// Factory method used to create a full name (male).
        /// </summary>
        /// <returns>A randomly generated full name for a male.</returns>
        public static string CreateMaleFullName()
        {
            return CreateMaleFirstName() + " " + CreateSurname();
        }
        /// <summary>
        /// Factory method used to create a full name (female).
        /// </summary>
        /// <returns>A randomly generated full name for a female.</returns>
        public static string CreateFeamleFullName()
        {
            return CreateFemaleFirstName() + " " + CreateSurname();
        }
        /// <summary>
        /// Factory method used to create a full name, not indicative of gender.
        /// </summary>
        /// <returns>A random full name based on a random gender.</returns>
        public static string CreateFullName()
        {
            int random = _Random.Next(0, 1);

            if (random == 0)
                return CreateMaleFullName();
            else
                return CreateFeamleFullName();
        }
        /// <summary>
        /// Factory method used to create a first name, not indicative of gender.
        /// </summary>
        /// <returns>A random first name based on a random gender</returns>
        public static string CreateFirstName()
        {
            int random = _Random.Next(0, 1);

            if (random == 0)
                return CreateMaleFirstName();
            else
                return CreateFemaleFirstName();
        }
    }
}
